<?php
/*
 * Glorious Framework
 *
 * Form Security nonce helper functions
 *
 * (c) 2007-2010 Konspire Design
 *
 * $Id: nonce_helper.php,v 204646426a58 2010/04/29 12:06:51 and $
 * $Author: and $
 * $Date: 2010/04/29 12:06:51 $
 */

function nonce_field_name() {
    return nonce::instance()->get_nonce_field();
}

function nonce($action = -1) {
    return nonce::instance()->create_nonce($action);
}

function nonce_field($action = -1, $atts = array())
{
    $defaults = array();

    $defaults['name'] = nonce_field_name();
    $defaults['value'] = nonce($action);

    $atts = _::parse_args($atts, $defaults);
    
    return form_hidden($atts);
}

/* End of file nonce_helper.php */
/* Location: ./system/helpers/nonce_helper.php */